import React from 'react';
import {Map, CityListControl, MapTypeControl, NavigationControl, ScaleControl, ZoomControl, TrafficLayer} from 'react-bmapgl';

const map: React.FC = () => {

  const {innerWidth, innerHeight} = window;

  return (
    <Map
      style={{ height: innerHeight - 60, width: innerWidth }}
      center={new BMapGL.Point(114.2307519546763, 29.57908428837437)}
      zoom={12}
      heading={0}
      tilt={40}
      mapType={"earth"}
      onClick={(e: any) => console.log(e)}
      enableScrollWheelZoom
    >
      <CityListControl />
      <MapTypeControl />
      <NavigationControl />
      <ScaleControl />
      <ZoomControl />
      <TrafficLayer />
    </Map>
  )

};

export default map;
